package com.itheima.d4_Api_Object;

/**
 * java object的API：equals的使用
 */
public class test_equals {
    public static void main(String[] args) {
        student s1 = new student("王小波",18, '男');
        student s2 = new student("王小波",18, '男');


       // System.out.println(s1.equals(s2));
        //运行结果：false
        //object的equals会默认比较两个对象的地址是否相同
        //需要重写equals函数

        System.out.println(s1.equals(s2));
    }
}
